using UnityEngine;
using UnityEngine.UI;

public class FormUIImage : MonoBehaviour {

    [SerializeField]
    string _form = "";

    [SerializeField]
    Image _graphic;

    [SerializeField]
    Image _iconImage;

    [SerializeField]
    Color _normalColor;

    [SerializeField]
    Color _highlightColor;

    #region Properties
    public string Form {
        get { return _form; }
        set { _form = value; }
    }

    public FormController FormControllerComponent { get; set; }

    public Image Graphic {
        get { return _graphic; }
        set { _graphic = value; }
    }

    public Image IconImage {
        get { return _iconImage; }
        set { _iconImage = value; }
    }
    #endregion

    void Awake() {
        Graphic.CrossFadeColor(_normalColor, 0, true, true);
    }

    [ContextMenu("Select")]
    public void Select() {
        Graphic.CrossFadeColor(_highlightColor, .3f, true, true);
    }

    [ContextMenu("Deselect")]
    public void Deselect() {
        Graphic.CrossFadeColor(_normalColor, .3f, true, true);
    }
}